package java8_26;

/**
 * @author oldliu
 * @since 1.0
 */
public class Cat {
    private String name;
    private double weight;
    private int strength;
    public String name(){
        return name;
    }
    public double weight(){
        return weight;
    }
    int strength(){
        return strength;
    }
    public Cat(String name,double weight,int strength){
        this.name=name;
        this.weight=weight;
        this.strength=strength;
    }
    public void cat(){
        System.out.println("这只猫叫"+name+",体重"+weight+"千克,体力"+strength);
    }
    public void grab(Mouse mou){
        this.strength+=20;
        mou.setStrength(0);
        System.out.println(name+"捉到了"+mou.name()+","+name+"体力加20为"+strength);
        System.out.println(mou.name()+"的体力变成了"+(mou.strength()));
    }
//    public void grab(Mouse mou){
//        System.out.println(name+"捉到了"+mou.name()+","+name+"体力加20为"+(strength+20));
//        System.out.println(mou.name()+"的体力变成了"+(mou.strength()*0));
//    }
}
